package model;

import javax.persistence.ManyToOne;
import javax.persistence.Lob;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import static javax.persistence.TemporalType.TIMESTAMP;

@Entity
public class Attempt implements Serializable {

    private static final long serialVersionUID = 1L;

    public enum SurveyStatus {

        Partial, Completed, Acceptable
    }

    public enum ReportLinkAcknowledge {

        No, Yes
    }
    @Id
    @GeneratedValue
    private long attempt_id;
    @Basic
    @Temporal(TIMESTAMP)
    private Date timestamps;
    @Basic
    private SurveyStatus status;
    @Basic
    private ReportLinkAcknowledge ack;
    @Basic
    private String link;
    @Basic
    private String company_name;
    @Basic
    private String company_size;
    @Basic
    private String it_dept_size;
    @Basic
    private String title;
    @Basic
    private String ip_address;
    @Basic
    private String country;
    @OneToMany
    private Collection<Scoring> scoring;
    @OneToMany
    private Collection<ThemeScore> themeScore;
    @ManyToOne
    private Industry industry;
    @Lob
    private byte[] pdfStream;
    @Basic
    private long pu_id;

    public ReportLinkAcknowledge getAck() {
        return ack;
    }

    public void setAck(ReportLinkAcknowledge ack) {
        this.ack = ack;
    }

    public long getAttempt_id() {
        return attempt_id;
    }

    public void setAttempt_id(long attempt_id) {
        this.attempt_id = attempt_id;
    }

    public String getCompany_name() {
        return company_name;
    }

    public void setCompany_name(String company_name) {
        this.company_name = company_name;
    }

    public String getCompany_size() {
        return company_size;
    }

    public void setCompany_size(String company_size) {
        this.company_size = company_size;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public Industry getIndustry() {
        return industry;
    }

    public void setIndustry(Industry industry) {
        this.industry = industry;
    }

    public String getIp_address() {
        return ip_address;
    }

    public void setIp_address(String ip_address) {
        this.ip_address = ip_address;
    }

    public String getIt_dept_size() {
        return it_dept_size;
    }

    public void setIt_dept_size(String it_dept_size) {
        this.it_dept_size = it_dept_size;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public byte[] getPdfStream() {
        return pdfStream;
    }

    public void setPdfStream(byte[] pdfStream) {
        this.pdfStream = pdfStream;
    }

    public Collection<Scoring> getScoring() {
        return scoring;
    }

    public void setScoring(Collection<Scoring> scoring) {
        this.scoring = scoring;
    }

    public SurveyStatus getStatus() {
        return status;
    }

    public void setStatus(SurveyStatus status) {
        this.status = status;
    }

    public Collection<ThemeScore> getThemeScore() {
        return themeScore;
    }

    public void setThemeScore(Collection<ThemeScore> themeScore) {
        this.themeScore = themeScore;
    }

    public Date getTimestamps() {
        return timestamps;
    }

    public void setTimestamps(Date timestamps) {
        this.timestamps = timestamps;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public long getPu_id() {
        return pu_id;
    }

    public void setPu_id(long pu_id) {
        this.pu_id = pu_id;
    }
}
